package isUgly;

public class Solution {
    public static void main(String[] args) {
    }
    public static boolean isUgly(int n) {
        //2^n*3^m*5^k
        while(n>0){
            if(n%2==0){
                n/=2;
                continue;
            }
            if(n%3==0){
                n/=3;
                continue;
            }
            if(n%5==0){
                n/=3;
                continue;
            }
            break;
        }
        return n==0;
    }
}
